TARGETMODULE := hello

ifneq ($(KERNELRELEASE),)

obj-m := $(TARGETMODULE).o

else

KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

all:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

load:
	sudo insmod ./hello.ko

unload:
	sudo rmmod ./hello.ko

endif
